<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">

  <title> index</title>

  <!-- Bootstrap core CSS -->
  <link rel="stylesheet" href="../../public/css/bootstrap.css">
  <!-- Custom styles for this template -->
  <link href="../../public/css/main.css" rel="stylesheet">

</head>

<body>
  <nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
          aria-expanded="false" aria-controls="navbar">
          <span class="sr-only"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">my node demo</a>
      </div>
      <div id="navbar" class="navbar-collapse collapse">
        <ul class="nav navbar-nav navbar-right">
          <li><a href="#">Dashboard</a></li>
          <li><a href="#">Settings</a></li>
          <li><a href="#">Profile</a></li>
          <li><a href="#">Help</a></li>
        </ul>
        <form class="navbar-form navbar-right">
          <input type="text" class="form-control" placeholder="Search...">
        </form>
      </div>
    </div>
  </nav>

  <div class="container-fluid">
    <div class="row">
      <div class="col-sm-3 col-md-2 sidebar">
        <ul class="nav nav-sidebar">
          <li class="active"><a href="#">Overview <span class="sr-only">(current)</span></a></li>
          <li><a href="#">Reports</a></li>
          <li><a href="#">Analytics</a></li>
          <li><a href="#">Export</a></li>
        </ul>
      </div>
      <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        <h2 class="sub-header">Section title</h2>
        <a class="btn btn-success" href="/add">添加</a>
        <div class="table-responsive">
          <table class="table table-striped">
            <thead>
              <tr>
                <th>id</th>
                <th>name</th>
                <th>gender</th>
                <th>age</th>
                <th>hobbies</th>
                <th>edit</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>1,001</td>
                <td>Lorem</td>
                <td>ipsum</td>
                <td>dolor</td>
                <td>sit</td>
              </tr>
              {{each data}}
              <tr>
                <td>{{$value.id}}</td>
                <td>{{$value.name}}</td>

                {{if $value.gender=="0"}}
                <td>男</td>
                {{else if $value.gender=="1"}}
                <td>女</td>
                {{/if}}

                <td>{{$value.age}}</td>
                <td>{{$value.hobbies}}</td>

                <td>
                  <a href="/edit?id={{$value.id}}"> 编辑</a>
                  <a href="/delete?id={{$value.id}}"> 删除</a>
                </td>
              </tr>
              {{/each}}
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>

  <script src="./../../public/js/jquery-1.12.4.js"></script>
  <script src="./../../public/js/bootstrap.min.js"></script>
</body>

</html>